feat: add stats/incr/nanmidrange#6149
Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
Planeshifter
left a comment
There was a problem hiding this comment.
Thanks for your PR! I left some review comments; better later than never, I thought.
| @@ -0,0 +1,63 @@ | |||
| /* | |||
There was a problem hiding this comment.
This file should be named test.ts (lowercase), not Test.ts. The stdlib convention is to use only lowercase letters, numbers, and underscores in filenames. If you look at the reference @stdlib/stats/incr/midrange/docs/types/, the file is test.ts.
| * ## Notes | ||
| * | ||
| * - The mid-range is the arithmetic mean of maximum and minimum values. Accordingly, the mid-range is the midpoint of the range and a measure of central tendency. | ||
| * - If provided `NaN` or a value which, when used in computations, results in `NaN`, the accumulated value is `NaN` for all future invocations. |
There was a problem hiding this comment.
This note was carried over from the non-nan incrmidrange type definition, but it's incorrect here. The whole point of nanmidrange is that NaN values are ignored, not propagated. This line tells users the exact opposite of what the function does.
We should remove this note entirely.
Requested changes applied in the maintainer cleanup commit: renamed Test.ts to test.ts and removed the incorrect NaN note in index.d.ts. Dismissing the stale review.
- Rename docs/types/Test.ts to test.ts so the TypeScript type test is picked up on case-sensitive filesystems - Remove the incorrect NaN-propagation note from index.d.ts (the accumulator ignores NaN) - Correct the accumulator JSDoc @returns type to (number|null) - Drop backticks from package.json description; add nan/ignore keywords - Simplify examples output and guard against a null accumulated value - Bump copyright year to 2026
PR Commit MessagePlease review the above commit message and make any necessary adjustments. |
Resolves #5578
Description
This pull request:
Related Issues
This pull request:
stats/incr/nanmidrange#5578Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers